package com.mall.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mall.db.domain.Footprint;
import com.mall.db.service.FootprintService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author wxd
 * @since 2021-09-23
 */
@Controller
@RequestMapping("/system/fc")
public class FootprintController extends BaseController<Footprint>{

    @Resource(name = "footprintService")
    private FootprintService fs;

    @Override
    public Map<String, Object> find(Footprint footprint) {

        PageHelper.startPage(footprint.getPage(),footprint.getLimit());

        QueryWrapper<Footprint> qw = new QueryWrapper<>();

        List<Footprint> list = fs.list(qw);

        PageInfo<Footprint> page = new PageInfo<>(list,footprint.getLimit());

        return findMap(page.getList(),page.getTotal());
    }
}

